import Vue from 'vue';
import Vuex from 'vuex';
import demoModules from '@/vuex/modules/demoModules';

Vue.use(Vuex);

const state = {
  demo: 'demoData'
};

const getters = {
  demo: state => state.demo,
};

const mutations = {
  updateDemo (state, data) {
    console.log('修改', data);
    state.demo = data;
  }
};

export default new Vuex.Store({
  modules: {
    demoModules,
  },
  state,
  mutations,
  getters
});
